package com.sch.wanandroid.entity

import android.os.Parcel
import android.os.Parcelable

/**
 * Created by Sch.
 * Date: 2020/4/26
 * description:
 */
data class UserCoinInfo(
    var coinCount: String?,
    var level: String?,
    var rank: String?,
    var userId: String?,
    var username: String?
) :Parcelable{
    constructor(parcel: Parcel) : this(
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString()
    )
    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(coinCount)
        parcel.writeString(level)
        parcel.writeString(rank)
        parcel.writeString(userId)
        parcel.writeString(username)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<UserCoinInfo> {
        override fun createFromParcel(parcel: Parcel): UserCoinInfo {
            return UserCoinInfo(parcel)
        }

        override fun newArray(size: Int): Array<UserCoinInfo?> {
            return arrayOfNulls(size)
        }
    }
}
